package com.yc.demo.mq;

import com.alibaba.fastjson.JSON;
import com.yc.demo.vo.MessageDTO;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * <p></p>
 *
 * @author: YuanChilde
 * @date: 2020-02-24 16:28
 * @version: 1.0
 * Modification History:
 * Date    Author      Version     Description
 * -----------------------------------------------------------------
 * 2020-02-24 16:28    YuanChilde     1.0        新增
 */
@Service
@RocketMQMessageListener(topic = "xx-topic", consumerGroup = "esignGroup1",selectorExpression = "sign")
public class MsgEvent2Consumer implements RocketMQListener<MessageDTO> {

    @Override
    public void onMessage(MessageDTO messageDTO) {
        System.out.println(JSON.toJSONString(messageDTO));
    }
}
